<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class InsertAreaDongguanAndZhongshanAreas extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        \App\Models\Area::query()->insert([
            // 东莞市下
            ['code' => 441901, 'name' => '东城街道', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441902, 'name' => '南城街道', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441903, 'name' => '万江街道', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441904, 'name' => '莞城街道', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441905, 'name' => '石碣镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441906, 'name' => '石龙镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441907, 'name' => '茶山镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441908, 'name' => '石排镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441909, 'name' => '企石镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441910, 'name' => '横沥镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441911, 'name' => '桥头镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441912, 'name' => '谢岗镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441913, 'name' => '东坑镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441914, 'name' => '常平镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441915, 'name' => '寮步镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441916, 'name' => '樟木头镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441917, 'name' => '大朗镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441918, 'name' => '黄江镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441919, 'name' => '清溪镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441920, 'name' => '塘厦镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441921, 'name' => '凤岗镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441922, 'name' => '大岭山镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441923, 'name' => '长安镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441924, 'name' => '虎门镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441925, 'name' => '厚街镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441926, 'name' => '沙田镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441927, 'name' => '道滘镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441928, 'name' => '洪梅镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441929, 'name' => '麻涌镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441930, 'name' => '望牛墩镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441931, 'name' => '中堂镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441932, 'name' => '高埗镇', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441933, 'name' => '松山湖管委会', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441934, 'name' => '东莞港', 'cityCode' => 4419, 'provinceCode' => 44],
            ['code' => 441935, 'name' => '东莞生态园', 'cityCode' => 4419, 'provinceCode' => 44],
            // 中山市下
            ['code' => 442001, 'name' => '石岐街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442002, 'name' => '东区街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442003, 'name' => '中山港街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442004, 'name' => '西区街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442005, 'name' => '南区街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442006, 'name' => '五桂山街道', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442007, 'name' => '小榄镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442008, 'name' => '黄圃镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442009, 'name' => '民众镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442010, 'name' => '东凤镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442011, 'name' => '东升镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442012, 'name' => '古镇镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442013, 'name' => '沙溪镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442014, 'name' => '坦洲镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442015, 'name' => '港口镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442016, 'name' => '三角镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442017, 'name' => '横栏镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442018, 'name' => '南头镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442019, 'name' => '阜沙镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442020, 'name' => '南朗镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442021, 'name' => '三乡镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442022, 'name' => '板芙镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442023, 'name' => '大涌镇', 'cityCode' => 4420, 'provinceCode' => 44],
            ['code' => 442024, 'name' => '神湾镇', 'cityCode' => 4420, 'provinceCode' => 44],
        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        \App\Models\Area::query()
            ->whereIn('code', [
                // 东莞市
                441931, 441902, 441923, 441913, 441916, 441904, 441906, 441911, 441903,
                441929, 441924, 441912, 441905, 441907, 441901, 441928, 441927, 441932,
                441909, 441921, 441922, 441933, 441919, 441930, 441925, 441914, 441915,
                441908, 441910, 441920, 441918, 441917, 441934, 441935, 441926,
                // 中山市
                442001, 442002, 442003, 442004, 442005, 442006, 442007, 442008, 442009,
                442010, 442011, 442012, 442013, 442014, 442015, 442016, 442017, 442018,
                442019, 442020, 442021, 442022, 442023, 442024,
            ])
            ->delete();
    }
}
